[PWGHF] Fix PID assignment in Xic0 and Omegac0 candidate creator#16352
Conversation
|
O2 linter results: ❌ 0 errors, |
| }; | ||
|
|
||
| // Convert the KFParticle PDG code to the O2 track PID enum needed by getTrackParCovFromKFP() | ||
| o2::track::PID::ID getTrackPIDFromPDG(const int pdg) |
There was a problem hiding this comment.
There is no way this conversion does not exist in some common utilities yet.
There was a problem hiding this comment.
@vkucera I had a quick look in O2 and O2Physics and I didn't find any common utility. Similar functions are defined in a couple of other places (
andO2Physics/Common/Tools/PID/pidTPCModule.h
Line 142 in 9eebc16
Do you have a concrete common utility that could be used?
There was a problem hiding this comment.
Thanks for the links. I expected this to already exist somewhere close to the declaration of the o2::track::PID::ID but it seems I was wrong.
| case 211: | ||
| return o2::track::PID::Pion; | ||
| case 321: | ||
| return o2::track::PID::Kaon; |
There was a problem hiding this comment.
@mtorresc15 You can have a look here https://root.cern/doc/v640/TPDGCode_8h.html for the PDG constant definitions.
This PR fixes the PID assignment passed to getTrackParCovFromKFP() in candidateCreatorXic0Omegac0.cxx.
KFParticle::GetPDG() returns a PDG code, while getTrackParCovFromKFP() expects an o2::track::PID enum. This PR adds a helper function to convert the PDG code to the corresponding PID enum before calling getTrackParCovFromKFP().
@fcatalan92 @jinhyunni